#include "OctreeNode.h"
#include <SEngine/Render/Entity/Octree.h>

namespace SEngine
{
    OctreeNode::OctreeNode(Octree& tree, BoundingBox boundingBox)
        : m_tree(tree), m_boundingBox(boundingBox)
    {

    }

    void OctreeNode::Split()
    {
        for (auto subBox : m_boundingBox.Split()) {
            m_children.emplace_back(m_tree.CreateNode(subBox).weak_from_this());
        }
    }


} // namespace SEngine
